//
//  MeetingInviteCell.m
//  iHeima
//
//  Created by he chao on 5/28/14.
//  Copyright (c) 2014 leon. All rights reserved.
//

#import "MeetingInviteCell.h"

@implementation MeetingInviteCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)initSelf{
    btnStatus = [BaseButton initBaseBtn:nil highlight:nil];
    btnStatus.frame = CGRectMake(0, 0, 40, 50);
    [self addSubview:btnStatus];
    
    avatarView = [AvatarView initFrame:CGRectMake(btnStatus.right, 10, 30, 30) image:nil borderColor:[UIColor clearColor]];
    avatarView.backgroundColor = [UIColor grayColor];
    [self addSubview:avatarView];
    
    name = [BaseLabel initLabel:@"Leon He" font:FONT(14) color:kNormalColor textAlignment:NSTextAlignmentLeft];
    name.frame = CGRectMake(avatarView.right+15, 0, 200, 50);
    [self addSubview:name];
}

- (void)load{
    [btnStatus setImage:IMAGESTRING(@"meeting_uncheck") forState:UIControlStateNormal];
    btnStatus.userInteractionEnabled = NO;
    name.text = self.dictUser[@"username"];
    if ([self.dictUser[@"check"] boolValue]) {
        [btnStatus setImage:IMAGESTRING(@"meeting_check") forState:UIControlStateNormal];
    }
    [avatarView setImageWithURL:[NSString stringWithFormat:@"%@avatar.php?uid=%@&size=middle",kPicUrl,self.dictUser[@"uid"]] placeholderImage:IMAGESTRING(@"default_avatar")];
}



@end
